







<div class="x-body">

    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so search-form">
            <input class="layui-input"  autocomplete="off" placeholder="开始日" name="date1"  value="{:input('date1')}" id="start">
            <input class="layui-input"  autocomplete="off" placeholder="截止日" name="date2"  value="{:input('date2')}" id="end">
            <input type="text" name="search_data"  placeholder="买家用户名|UID" autocomplete="off" value="{:input('search_data')}"  class="layui-input">
            <input type="text" name="search_data1"  placeholder="卖家用户名|UID" autocomplete="off" value="{:input('search_data1')}"  class="layui-input">
            <div class="layui-input-inline">
                <select name="pay_type">
                    <option value="" >全部支付方式</option>
                    <option value="1" {notempty name="param['pay_type']"}{if condition="$param['pay_type'] eq 1"} selected="selected" {/if}{/notempty} >支付宝</option>
                    <option value="2" {notempty name="param['pay_type']"}{if condition="$param['pay_type'] eq 2"} selected="selected" {/if}{/notempty} >微信</option>
                    <option value="3" {notempty name="param['pay_type']"}{if condition="$param['pay_type'] eq 3"} selected="selected" {/if}{/notempty} >银行卡</option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="wallet_id">
                    <option value="" >全部币种</option>
                    <option value="1" {notempty name="param['wallet_id']"}{if condition="$param['wallet_id'] eq 1"} selected="selected" {/if}{/notempty} >总包</option>
                    {volist name='wallet' id='vo'}
                    <option value="{$vo['id']}" {notempty name="param['wallet_id']"}{if condition="$param['wallet_id'] eq $vo['id']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="state">
                    <option value="" >全部状态</option>
                    <option value="1" {notempty name="param['state']"}{if condition="$param['state'] eq 1"} selected="selected" {/if}{/notempty} >买家未支付</option>
                    <option value="2" {notempty name="param['state']"}{if condition="$param['state'] eq 2"} selected="selected" {/if}{/notempty} >已完成</option>
                    <option value="3" {notempty name="param['state']"}{if condition="$param['state'] eq 3"} selected="selected" {/if}{/notempty} >买家已支付</option>
                    <option value="4" {notempty name="param['state']"}{if condition="$param['state'] eq 4"} selected="selected" {/if}{/notempty} >买家已取消</option>
                    <option value="5" {notempty name="param['state']"}{if condition="$param['state'] eq 5"} selected="selected" {/if}{/notempty} >已失效</option>
                    <!--<option value="6" {notempty name="param['state']"}{if condition="$param['state'] eq 6"} selected="selected" {/if}{/notempty} >申诉中</option>-->
                    <option value="7" {notempty name="param['state']"}{if condition="$param['state'] eq 7"} selected="selected" {/if}{/notempty} >付款超时</option>
                    <!--<option value="8" {notempty name="param['state']"}{if condition="$param['state'] eq 8"} selected="selected" {/if}{/notempty} >放行超时</option>-->
                    <option value="9" {notempty name="param['state']"}{if condition="$param['state'] eq 9"} selected="selected" {/if}{/notempty} >申诉成功-买家已打款</option>
                    <option value="10" {notempty name="param['state']"}{if condition="$param['state'] eq 10"} selected="selected" {/if}{/notempty} >申诉成功-店铺已放行</option>
                    <option value="11" {notempty name="param['state']"}{if condition="$param['state'] eq 11"} selected="selected" {/if}{/notempty} >申诉成功-买家未打款</option>
                    <option value="12" {notempty name="param['state']"}{if condition="$param['state'] eq 12"} selected="selected" {/if}{/notempty} >申诉成功-买家二次打款</option>
                    <option value="13" {notempty name="param['state']"}{if condition="$param['state'] eq 13"}  selected="selected" {/if}{/notempty} >申诉成功-店铺打款超时,转移重新匹配订单</option>
                </select>
            </div>

            <button class="layui-btn"  id="search"  url="{:url('trade_order_list')}"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>


        </form>
    </div>
    <xblock>
        <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
        <ob_link><a  href="{:url('OrderAdd')}" style="color: white">   <button class="layui-btn" > 批量生成充值订单</button></a></ob_link>


        <ob_link> <button class="layui-btn export" url="{:url('exportOtcOrderList')}"> 导 出</button></ob_link>
        <span class="x-right" style="line-height:40px;margin-right:10px;">共有数据：{$list.count} 条</span>
        <span class="x-right" style="line-height:40px; margin-right:10px;">ECT：{$list.ect}</span>
        <span class="x-right" style="line-height:40px; margin-right:10px;">BTC：{$list.btc}</span>
        <span class="x-right" style="line-height:40px; margin-right:10px;">USDT：{$list.usdt}</span>
    </xblock>
    <table class="layui-table x-admin">
        <thead>
        <tr>
            <th>
                序号
            </th>
            <th>店铺信息</th>
            <th>店铺订单信息</th>
            <th>买家信息</th>
            <th>交易信息</th>
            <th>其他</th>
            <th>操作</th>
        </thead>
        {notempty name='list.list'}
        <tbody>
        {volist name='list.list' id='vo' key="k"}
        <tr>
            <td class="">
                {$k}
            </td>
            {if condition="$vo.otc_type eq 1"}
                <td class="col-md-2 ">
                    <div> <label>UID:</label><span>{$vo.user_id}</span></div>
                    <div><label>用户名:</label><span>{$vo.member.username}</span>{if condition ="$vo.member.is_company eq 1"}<span style="color: #f56c6c">(公司账户)</span>{/if}</div>
                    <div> <label>手机号码:</label><span>+{$vo.member.area}{$vo.member.mobile}</span></div>
                    <div>  <label>店铺名称:</label><span>{$vo.shop_name}</span></div>
                    <div>  <label>付款方式:</label><span>{$vo.trade.pay_text}</span></div>
                </td>

            {else/}
            <td class="col-md-2 ">
                <div> <label>UID:</label><span>{$vo.uid}</span></div>
                <div><label>用户名:</label><span>{$vo.user.username}</span>{if condition ="$vo.user.is_company eq 1"}<span style="color: #f56c6c">(公司账户)</span>{/if}</div>
                <div> <label>手机号码:</label><span>+{$vo.user.area}{$vo.user.mobile}</span></div>
                <div>  <label>店铺名称:</label><span>{$vo.shop_name}</span></div>
                <div>  <label>收款方式:</label><span>{$vo.trade.pay_text}</span></div>
            </td>

            {/if}

            <td class="col-md-2 ">
                <div><label>{if condition="$vo.otc_type eq 1"}代发{else/}代收{/if}订单金额:</label><span>{$vo.trade.total}</span></div>
                <div> <label>货币类型:</label><span>{$vo.wallet->name}</span></div>
                <div>  <label>货币单价:</label><span>{$vo.price}</span></div>
                <div>  <label>货币数量:</label><span>{$vo.trade.number}</span></div>
                <div>  <label>已交易数量:</label><span>{$vo.trade.number-$vo.trade.surplus_number}</span></div>
                <div>  <label>剩余数量:</label><span>{$vo.shop.number_do+$vo.shop.cancel_number}</span></div>

            </td>


            {if condition="$vo.otc_type eq 2"}
            <td class="col-md-2 ">
                <div> <label>UID:</label><span>{$vo.user_id}</span></div>
                <div><label>用户名:</label><span>{$vo.member.username}</span>{if condition ="$vo.member.is_company eq 1"}<span style="color: #f56c6c">(公司账户)</span>{/if}</div>
                <div> <label>手机号码:</label><span>+{$vo.member.area}{$vo.member.mobile}</span></div>
                <div><label>是否赌王:</label><span>{if condition ="$vo.member.is_king eq 1"}是{else/}否{/if}</span></div>

            </td>

            {else/}
            <td class="col-md-2 ">
                <div> <label>UID:</label><span>{$vo.uid}</span></div>
                <div><label>用户名:</label><span>{$vo.user.username}</span>{if condition ="$vo.user.is_company eq 1"}<span style="color: #f56c6c">(公司账户)</span>{/if}</div>
                <div> <label>手机号码:</label><span>+{$vo.user.area}{$vo.user.mobile}</span></div>
                <div><label>是否赌王:</label><span>{if condition ="$vo.user.is_king eq 1"}是{else/}否{/if}</span></div>
            </td>

            {/if}
            <td class="col-md-2 ">
                <div><label>币种:</label><span>{$vo.wallet->name}</span></div>
                <div> <label>交易数量:</label><span>{$vo.number}</span></div>
                <div>  <label>交易单价:</label><span>{$vo.price}</span></div>
                <div>  <label>交易金额:</label><span>{$vo.total}</span></div>
                <div>  <label>交易时间:</label><span>{$vo.create_time}</span></div>



            </td>
            <td class="col-md-2 ">
                <div> <label>状态:</label><span>{$vo.state_text}</span>{if condition ="$vo.contractorder1 eq true"}<span style="color: #f56c6c">(已转移)</span>{/if}</div>
                <div> <label>付款时间:</label><span>{if condition ="$vo.state eq 3 || $vo.state eq 2 || $vo.state eq 8 "}{$vo.pay_time}{/if}</span></div>
                <div><label>放行时间:</label><span>{if condition ="$vo.state eq 2"}{$vo.receive_time}{/if}</span></div>
                <div><label>交易耗时:</label><span>{if condition ="$vo.state eq 2"}{$vo.receive_minute}分钟{/if}</span></div>
            </td>
            <td class="col-md-2">
                <div style="margin-bottom: 5px;"><label></label><span>   <ob_link><a title="查看详情" style="color: #0a8cd2"  href="{:url('trade_order_detail', array('id' => $vo['id']))}" >
                    查看详情
                </a></ob_link></span></div>
                {if condition="$vo.state eq 1 " condition="$vo.state eq 12 "}
                <div style="margin-bottom: 5px;"><label></label><span>   <ob_link><a class="ajax-get " style="color: #0a8cd2" href="{:url('trade_order_detail', array('id' => $vo['id'], 'state' =>4,'update'=>1))}">  取消订单</a></ob_link></span></div>
                {/if}

                {if condition="$vo.state eq 1 "}
                <div style="margin-bottom: 5px;"><label></label><span>   <a style="color: #0a8cd2" href="javascript:reply({$vo.id});">  买家已付款</a></span></div>
                {/if}
                {if condition="$vo.state eq 3 "}
                <div style="margin-bottom: 5px;"><label></label><span>   <ob_link><a class="ajax-get " style="color: #0a8cd2" href="{:url('trade_order_detail', array('id' => $vo['id'], 'state' =>2,'update'=>1))}">  店铺已放行</a></ob_link></span></div>
                {/if}


            </td>
        </tr>
        {/volist}
        {else/}
        <tbody><tr class="odd"><td colspan="12" class="" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
        {/notempty}

        </tbody>
    </table>
    <div class="page">
        {notempty name='list.list'}   {$list.list->render()}{/notempty}
    </div>

</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        layer=layui.layer;
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });


    function reply(id ) {
        layer.open({
            type: 2 //此处以iframe举例
            ,title: '买家付款'
            ,area: ['50%', '70%']
            ,shade: 0
            ,maxmin: true
            ,content: "trade_order_list?id="+id+'&otcorder=1'
            ,btn: [] //只是为了演示
        });

    }





    //导出功能
    $(".export").click(function(){

        window.location.href = searchFormUrl($(".export"));
    });
</script>

</body>

</html>

